<?php /* Smarty version Smarty-3.1.15, created on 2016-10-12 12:42:26
         compiled from "D:\Program Files (x86)\USBWebserver v8.6\root\jh_source\admin\track\include\template\one_page_shop\tongji.tpl" */ ?>
<?php /*%%SmartyHeaderCode:380657e0e9b114c414-55148404%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'a32ca47a9bc4c1bbece56ec9533403b75db4035f' => 
    array (
      0 => 'D:\\Program Files (x86)\\USBWebserver v8.6\\root\\jh_source\\admin\\track\\include\\template\\one_page_shop\\tongji.tpl',
      1 => 1476247333,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '380657e0e9b114c414-55148404',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.15',
  'unifunc' => 'content_57e0e9b115fca8_37606712',
  'variables' => 
  array (
    'osadmin_action_alert' => 0,
    'osadmin_quick_note' => 0,
    '_POST' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_57e0e9b115fca8_37606712')) {function content_57e0e9b115fca8_37606712($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ("header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

<?php echo $_smarty_tpl->getSubTemplate ("navibar.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

<?php echo $_smarty_tpl->getSubTemplate ("sidebar.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

<!-- START 以上内容不需更改，保证该TPL页内的标签匹配即可 -->
<?php echo $_smarty_tpl->tpl_vars['osadmin_action_alert']->value;?>

<?php echo $_smarty_tpl->tpl_vars['osadmin_quick_note']->value;?>


<div class="well">
    <ul class="nav nav-tabs">
        <li class="active"><a href="#home" data-toggle="tab">添加统计代码</a></li>
    </ul>

    <div id="myTabContent" class="tab-content">
        <div class="tab-pane active in" id="home">

            <form id="tab" method="post" action="">
                <label>在线统计代码1</label>
                <textarea name="code1" id="code1" rows="5" cols="60" class="input-xlarge"><?php echo $_smarty_tpl->tpl_vars['_POST']->value['code1'];?>
</textarea>

                <label>在线统计代码2</label>
                <textarea name="code2" id="code2" rows="5" cols="60" class="input-xlarge"><?php echo $_smarty_tpl->tpl_vars['_POST']->value['code2'];?>
</textarea>

                <label>在线统计代码3</label>
                <textarea name="code3" id="code3" rows="5" cols="60" class="input-xlarge"><?php echo $_smarty_tpl->tpl_vars['_POST']->value['code3'];?>
</textarea>

                <div class="btn-toolbar">
                    <button type="button" class="btn btn-primary" onclick="tijiao()"><strong>提交</strong></button>
                </div>
            </form>
        </div>
    </div>
</div>


<script>

    function htmlEncodeByRegExp(str) {
        var s = "";
        if (str.length == 0) return "";
        s = str.replace(/&/g, "&amp;");
        s = s.replace(/</g, "&lt;");
        s = s.replace(/>/g, "&gt;");
        s = s.replace(/ /g, "&nbsp;");
        s = s.replace(/\'/g, "&#39;");
        s = s.replace(/\"/g, "&quot;");
        return s;
    }


    function tijiao() {
        var c1, c2, c3;
        if ($("#code1").val()) {
            c1 = htmlEncodeByRegExp($("#code1").val());
        } else {
            c1 = '';
        }

        if ($("#code2").val()) {
            c2 = htmlEncodeByRegExp($("#code2").val());
        } else {
            c2 = '';
        }
        if ($("#code3").val()) {
            c3 = htmlEncodeByRegExp($("#code3").val());
        } else {
            c3 = '';
        }
        $.ajax({
            url: 'tongji_edit.php',// 跳转到 action
            data: {
                "code1": c1,
                "code2": c2,
                "code3": c3
            },
            type: 'post',
            cache: false,
            dataType: 'json',
            success: function (data) {
                if (data.msg == "true") {
                    alert("提交成功");
                    window.location.reload();
                } else {
                    alert("服務器錯誤");
                    return;
                }
            },
            error: function () {
                alert("服務器錯誤！");
            }
        });
    }
</script>
<!-- END 以下内容不需更改，请保证该TPL页内的标签匹配即可 -->
<?php echo $_smarty_tpl->getSubTemplate ("footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
<?php }} ?>
